home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / program / amos / amcafext.lha / AMCAF_Examples / SetRainColour4.AMOS / SetRainColour4.amosSourceCode
AMOS Source Code  |  1995-07-14  |  2KB  |  78 lines

  1. ' ************************************* Commands used: 
  2. ' *                                   * Set Rain Colour
  3. ' *           Amcaf Examples          * Fcircle
  4. ' *      Set Rain Colour 4 V1.0       * Turbo Draw 
  5. ' *      Written by Chris Hodges      *
  6. ' *                                   *
  7. ' *************************************
  8. '
  9. ' *** WARNING!!! *** 
  10. ' This program will only work, if the AMOSPro.Lib Patch has been installed.
  11. ' Otherwise you'll get a very corrupted display. 
  12. '
  13. ' First, hide the mouse cursor for niceness. 
  14. Hide 
  15. ' Then open a 4 coloured screen. This one will be displayed in the background. 
  16. Screen Open 1,336,256,4,0
  17. Curs Off : Flash Off : Paper 0 : Pen 1 : Cls 0
  18. ' Hide it. 
  19. Palette 0,0,0,0
  20. ' Arrange the screen.
  21. Screen Display 1,128,40,320,200
  22. ' Use a x-offset that isn't a multiple of 16. This is a workaround for the 
  23. ' dual playfield bug.
  24. Screen Offset 1,1,0
  25. ' Draw some nice circles.
  26. For A=0 To 100
  27.   Ink Rnd(2)+1 : Extension_8_05E6 Rnd(320),Rnd(256),Rnd(7)+2
  28. Next 
  29. ' Now open the second screen.
  30. Screen Open 0,640,400,8,0
  31. Curs Off : Flash Off : Paper 0 : Pen 1 : Cls 0
  32. ' Hide it. 
  33. Palette 0,0,0,0,0,0,0,0
  34. Screen Display 0,128,40,320,256
  35. ' Draw some thick lines... 
  36. For A=1 To 40
  37.   X1=Rnd(640) : Y1=Rnd(400) : X2=Rnd(640) : Y2=Rnd(400)
  38.   C=Rnd(6)+1
  39.    Extension_8_1016 X1,Y1 To X2,Y2,C
  40.    Extension_8_1016 X1-1,Y1 To X2-1,Y2,C
  41.    Extension_8_1016 X1+1,Y1 To X2+1,Y2,C
  42.    Extension_8_1016 X1,Y1-1 To X2,Y2-1,C
  43.    Extension_8_1016 X1,Y1+1 To X2,Y2+1,C
  44. Next 
  45. ' and some circles.
  46. For A=1 To 40
  47.   Ink Rnd(6)+1 : Extension_8_05E6 Rnd(640),Rnd(400),Rnd(50)+10
  48. Next 
  49. ' Create the mirror-rainbow. 
  50. Set Rainbow 0,0,16,"","",""
  51. ' This is the new modulo value. Note that the formula is like this:
  52. ' ((VisibleWidth-RealWidth)-(VisibleWidth*ShrinkFactor)/8-2. 
  53. '
  54. ' *** Try different shrink factors! ***
  55. For A=0 To 15
  56.   Rain(0,A)=((320-640)-640*1)/8-2
  57. Next 
  58. ' Change the Rainbow Colour to the modify the even bitplanes modulo value. 
  59.  Extension_8_1330 0,($108-$180)/2
  60. Wait Vbl 
  61. ' Enable Dual Playfield and set the palette. 
  62. Dual Playfield 0,1
  63. Palette 0,$F00,$F0,$F,$F0F,$FF0,$FF,$FFF,$88,$880,$80,$808
  64. Wait Vbl 
  65. ' Limit the mouse and display the mirror-rainbow.
  66. Limit Mouse 128,40 To 287,239
  67. Rainbow 0,0,240,56
  68. ' Move the screen around using hardware scrolling. 
  69. Repeat 
  70.   Wait Vbl 
  71.   XM=X Mouse-128 : YM=Y Mouse-40
  72.   Screen Offset 0,XM*2+1,YM
  73. Until Inkey$=Chr$(27) or Mouse Key<>0
  74. ' Clean the display. 
  75. Rainbow Del : View 
  76. Screen Close 0
  77. Screen Close 1
  78. End